package cn.janyd.jmall.userweb.controller.passport.vo;

import cn.janyd.common.core.validator.Mobile;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author janyd
 * @since 2020/8/10 18:13
 */
@ApiModel("用户短信验证码登录")
@Data
@Accessors(chain = true)
public class PassportLoginBySmsReqVo implements Serializable {

    @ApiModelProperty(value = "手机号码", required = true, example = "137xxxxxxxx")
    @NotEmpty(message = "{mobile.is.blank}")
    @Mobile
    private String phone;

    @ApiModelProperty(value = "手机验证码", required = true, example = "888888")
    @NotEmpty(message = "{captcha.is.blank}")
    @Length(min = 6, max = 6, message = "{captcha.is.incorrect}")
    @Pattern(regexp = "^[0-9]+$", message = "{captcha.must.be.number}")
    private String code;


}
